/*
 * @Descripttion:
 * @version:
 * @Author: kl2018
 * @Date: 2020-05-06 14:55:11
 * @LastEditors: kl2018
 * @LastEditTime: 2020-06-23 16:34:24
 */
import querystring from 'querystring';

export default () => {
	const search = location.search.replace('?', '');
	const hashParams = location.hash.indexOf('?') > -1 ? location.hash.split('?')[1] : '';

	return {
		...querystring.parse(hashParams), // 兼容 #/xxx/xxx?x=x的方式
		...querystring.parse(search),
	};
};
